<?php
if (! defined ( 'BASEPATH' )) {
	exit ( 'No direct script access allowed' );
}
/**
 * 创建团队 上传 照片 个人图标
 * Enter description here ...
 * @author 庆安
 *
 */

class sczp extends CI_Controller {
	function __construct() {
		parent::__construct ();
		$this->load->helper ( 'url' );
		
	}
	
	function index($uploadType=1,$id=0) {
		$data["uploadType"]		= $uploadType;
		$data["id"]				= $id;
		$this->load->view ( 'headers/header02' );
		$this->load->view ( "sczp/sczp",$data );
		$this->load->view ( "footers/footer02" );
	}
	function sczpcutview($uploadType,$id){
		$_GET['uploadType']		= $uploadType;
		$_GET['id']				= $id;
		$this->load->view("sczp/sczp_cut",$_GET);
	}
	function cutIcon($uploadType=1,$id,$type='Filedata'){
		log_message("info" ,"get  data ==>".json_encode($_GET));
		$array=array();
		$tableName='wanwan_enum_user';
		if($uploadType!=1){
			$array['teamId']=$id;
			$tableName='wanwan_enum_team';
		}
		$array['userId']=$this->session->userdata("userId");
		$this->load->model("util/up_down_model");
		$cutImage=$this->up_down_model->upLoadIcon($type,$array,$tableName);
		log_message("info","cutInfo  ==>".$cutImage);
		echo $cutImage;
		
		
	}
	function imageUp($fileName='Filedata',$type='icon'){
		$this->load->model ( "util/up_down_model" );
		$array=$this->up_down_model->upLoadImage($fileName,$type);
		echo json_encode($array);
	}
}
?>